#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
	int k=0;
	scanf("%d", &k);
	int n = 100;
	for (n = 100; n <= 999; n++)
	{
		int b = n % 100;
		int d = n / 10;
		if (d % k == 0)
		{
			if (b % k == 0)

				if (n % k == 0)
					printf("%d\n", n);
		}
	}
	printf("None!");
    return 0;
}